<!DOCTYPE html>
<html>
<head>
<base href="/">
<meta charset="UTF-8">
<title>员工管理</title>
<link rel="stylesheet" href="lib/layui/css/layui.css">
</head>
<body>

	<table class="layui-table"
		lay-data="{ url:'staff/getList', page:true, id:'datalist',toolbar:'#top_toolbar'}"
		lay-filter="datalist">
		<thead>
			<tr>
				<th lay-data="{field:'id', sort:true}">ID</th>
				<th lay-data="{field:'login_name'}">用户名</th>
				<th lay-data="{field:'name',sort:true}">姓名</th>
				<th lay-data="{templet:'#statetext'}">状态</th>
				<th lay-data="{field:'createtime'}">创建时间</th>
				<th lay-data="{toolbar:'#line_toolbar'}">操作</th>
			</tr>
		</thead>
	</table>
	<!--	END数据表格-->


	<!--Start 新增窗口-->
	<div id="staff_addwin" style="display: none;" class="layui-form"
		lay-filter="staff_addwin">
		<form id="staff_addform">
			<div class="layui-form-item">
				<label class="layui-form-label">账号</label>
				<div class="layui-input-inline">
					<input type="text" lay-verify="required|login_item|no_repeat"
						name="login_name" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">姓名</label>
				<div class="layui-input-inline">
					<input type="text" lay-verify="required" name="name"
						class="layui-input">
				</div>
			</div>
		</form>
	</div>
	<!--END 新增-->
	<!--Start 编辑窗口-->
	<div id="staff_editwin" style="display: none;" class="layui-form"
		lay-filter="staff_editwin">
		<input type="hidden" name="id">
		<div class="layui-form-item">
			<label class="layui-form-label">账号</label>
			<div class="layui-input-inline">
				<input type="text" disabled name="login_name" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">姓名</label>
			<div class="layui-input-inline">
				<input type="text" lay-verify="required" name="name"
					class="layui-input">
			</div>
		</div>
	</div>
	<!--END 编辑-->
	<script type="text/html" id="statetext">
    {{#  if(d.state==0){ }}
    <span class="layui-badge layui-bg-blue">可登录</span>
    {{#  } else { }}
    <span class="layui-badge ">已离职</span>
    {{#  } }}
</script>
	<!--操作判断-->
	<script type="text/html" id="line_toolbar">
  <a class="layui-btn  layui-btn-sm layui-btn-radius" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger" lay-event="del" style="margin-left:0.8px">删除</a>
    {{#  if(d.state==0){ }}
 
    <a class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal" lay-event="dismissed" style="margin-left:0.8px">辞退</a>
    {{#  } else { }}
  
    <a class="layui-btn layui-btn-sm layui-btn-radius layui-btn-warm" lay-event="recover" style="margin-left:0.8px">恢复</a>
    {{#  } }}
</script>
	<!-- 头部工具栏 -->
	<script type="text/html" id="top_toolbar">

    <div class="layui-input-inline">
        <input type="text" name="check" class="layui-input" placeholder="查询">
    </div>
    <button class="layui-btn layui-btn" lay-event="check" style="background-color:#01AAED">查询</button>
    <button class="layui-btn layui-btn" lay-event="add" style="background-color:#FFB800">添加</button>


</script>
	<!--行内工具栏
<a class="layui-btn  layui-btn-xs layui-btn-lg" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
-->
	<script type="text/html" id="line_toolbar1">
    <a class="layui-btn  layui-btn-sm layui-btn-radius" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger" lay-event="del" style="margin-left:0.8px">删除</a>
    <a class="layui-btn layui-btn-sm layui-btn-radius layui-btn-warm" lay-event="recover" style="margin-left:0.8px">恢复</a>

</script>
	<script src="lib/layui/layui.all.js"></script>
	<!-- 声明layui需要的对象 -->
	<script src="js/layuibase.js"></script>
	<script src="js/staff.js"></script>
</body>
</html>